<%@ Page Language="C#" AutoEventWireup="true" 
    MasterPageFile="~/Medianamik/MasterPages/MedianamikModule.master" 
    CodeBehind="RedirectionsList.aspx.cs" 
    Inherits="Medianamik.UI.Web.RedirectManagement.Views.PublicationsList" %>
<%@ Import Namespace="Telerik.Web.UI"%>
<%@ Register TagName="MedianamikGrid" 
    Src="~/Medianamik/Modules/Views/UserControls/MedianamikGrid.ascx" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContextMenu" runat="server">
    <asp:HyperLink ID="AddArticleButton" runat="server" Target="TypeSelectorWindow"
        CssClass="Action BtAjouter" Text="<%$ Resources: ProtegezVous, AddArticleButtonText %>" />
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="VariableRightPanel" runat="server">
    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="CenterContent" runat="server">
    <div id="BoiteRecherche">
        <fieldset>
            
            
            <div style="clear:left;"></div>
        </fieldset>
        <asp:Button ID="FilterButton" runat="server" CssClass="Btn" Text="Rechercher" />
    </div>
    <uc:MedianamikGrid runat="server" ID="PublicationsGrid" AllowPaging="true" 
        EditUrl="/medianamik/modules/views/pages/publicationmanagement.aspx" />
    <p class="Titre12pxBordure"><asp:Literal runat="server" 
        Text="<%$ Resources: Medianamik_ContentManagement, CaptionLabel %>" /></p>
    <ul id="Legende">
        <li class="ElementBrouillon">
            <div><span></span></div>
            <asp:Literal runat="server" 
                Text="<%$ Resources: Medianamik_ContentManagement, DraftContentCaption %>" />
        </li>
    </ul>
    <br class="clearer" />
</asp:Content>

<asp:Content ID="ExternalContent" ContentPlaceHolderID="ExternalContentHolder" runat="server">
    <telerik:RadScriptBlock runat="server" ID="scriptBlock">

        <script type="text/javascript">
            //<![CDATA[
            
            Telerik.Web.UI.RadWindow.prototype.oldClose = Telerik.Web.UI.RadWindow.prototype.close;   
            Telerik.Web.UI.RadWindow.prototype.close = function(arg)   
            {   
                if (this.get_name() == 'deleteNodeWindow') 
                { 
                    deleteNodeWindowCallback(this, arg);
                } 
                else 
                { 
                    this.oldClose(arg); 
                } 
            }
            
            var deleteNodeId;
            
            function openDeleteNodeWindow(nodeID, cultureName) {
                if(!cultureName) cultureName = '';
                deleteNodeId = nodeID;
                radopen('/medianamik/modalwindows/DeleteNodeWindow.aspx?nodeid=' + nodeID + '&culturename=' + cultureName, 'deleteNodeWindow');
            }
            
            function deleteNodeWindowCallback(radWindow, returnValue) {
                if (returnValue && returnValue.mustReload) {
                    $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("");
                }
                closeDeleteNodeWindow();
            }
            
            function closeDeleteNodeWindow()
            {
                var oManager = GetRadWindowManager();
	            var oWnd = oManager.GetWindowByName('deleteNodeWindow');
                oWnd.oldClose();
            }

            function onNodeTypeSelected(radWindow, returnValue) {
                if (returnValue && returnValue.NodeTypeId) {
                    if (returnValue.ParentNodeId) {
                        location.href = '/medianamik/contentmanagement/nodemanagement.aspx?hidetreeview=true&typeid=' + returnValue.NodeTypeId + '&parentnodeid=' + returnValue.ParentNodeId + '<%= Grid.EditReturnUrl %>';
                    }
                    else {
                        location.href = '/medianamik/contentmanagement/nodemanagement.aspx?hidetreeview=true&typeid=' + returnValue.NodeTypeId + '<%= Grid.EditReturnUrl %>';
                    }
                }

                radWindow.Close();
            }
            
            //]]>
        </script>

    </telerik:RadScriptBlock>
</asp:Content>